﻿using System.Configuration;

namespace SimpleWcf.Configuration
{
    public class Settings : ConfigurationSection
    {
        /// <summary>
        /// Is the services should end with .svc
        /// </summary>
        [ConfigurationProperty("useSvcExtension", DefaultValue = "true", IsRequired = false)]
        public bool UseSvcExtension
        {
            get
            {
                return (bool)this["useSvcExtension"];
            }
            set
            {
                this["useSvcExtension"] = value;
            }
        }
        
        /// <summary>
        /// The base path to use for services.  Example: "Services"
        /// </summary>
        [ConfigurationProperty("serviceBasePath", DefaultValue = "", IsRequired = false)]
        public string ServiceBasePath
        {
            get
            {
                return (string)this["serviceBasePath"];
            }
            set
            {
                this["serviceBasePath"] = value;
            }
        }

        /// <summary>
        /// The assemblies to use to look for services
        /// </summary>
        [ConfigurationProperty("assemblies", IsRequired=false)]
        public ConfigurationElementCollection<ServiceAssembly> Assemblies
	    {
            get
            {
                return (ConfigurationElementCollection<ServiceAssembly>)this["assemblies"];
            }
	    }

    }
}